home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr52 / 5333de.zip / 5.PRG < prev    next >
Text File  |  1993-04-03  |  903b  |  39 lines

  1. // Update the client files CA of the Pears
  2. // This variation takes APPEND out of the loop.
  3. // and it takes the CA.dbf out completely.
  4. // and changes all the private variables to local
  5.  
  6. local I
  7. clear
  8.  
  9. FOR I = 1 TO 6000
  10.    X = NEW_ID("CA")
  11.    ? "REC#"+str(I,4)+"   "
  12.    ?? "string= "+str(memory(0),4)+"K  "+;
  13.                 "free  = "+str(memory(1),4)+"K  "+;
  14.                 "run   = "+str(memory(2),4)+"K  "+;
  15.                 "EMM   = "+str(memory(3),4)+"K  "
  16. next
  17.  
  18. Function NEW_ID(P1)
  19. ***************************************
  20. *
  21. ***************************************
  22. local   R,;   && returns the latest ID
  23.           W,;  && saves the previous workarea chosen
  24.           D
  25.  
  26. W = select()
  27. use IDS NEW
  28. locate for DS == PadR(P1, 8)
  29. if found()
  30.       D = val(NEWID)+1
  31.       R := PadL( D, len(trim(NEWID)), "0")
  32.       replace NEWID with R
  33. endif
  34.  
  35. use
  36. select (W)
  37. return R
  38.  
  39.